package com.zihao.view;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer;
import org.springframework.boot.web.servlet.ErrorPage;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.feign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.http.HttpStatus;

@SpringBootApplication
@EnableEurekaClient
@EnableFeignClients
/**
 * @author biscuit
 * @data 2018/05/10
 */
public class ViewServerApplication {
	@Bean
	public EmbeddedServletContainerCustomizer containerCustomizer() {

		return (container -> {
			ErrorPage error401Page = new ErrorPage(HttpStatus.UNAUTHORIZED, "/templates/sys/401.htmll");
			ErrorPage error404Page = new ErrorPage(HttpStatus.NOT_FOUND, "/templates/sys/401.html");
			container.addErrorPages(error401Page,error404Page);
		});
	}

	public static void main(String[] args) {
		SpringApplication.run(ViewServerApplication.class, args);
	}
}
